home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / LINUX / SUNRPC / SVCSOCK.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  2KB  |  59 lines

  1. /*
  2.  * linux/include/linux/sunrpc/svcsock.h
  3.  *
  4.  * RPC server socket I/O.
  5.  *
  6.  * Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
  7.  */
  8.  
  9. #ifndef SUNRPC_SVCSOCK_H
  10. #define SUNRPC_SVCSOCK_H
  11.  
  12. #include <linux/sunrpc/svc.h>
  13.  
  14. /*
  15.  * RPC server socket.
  16.  * NOTE: First two items must be prev/next.
  17.  */
  18. struct svc_sock {
  19.     struct svc_sock *    sk_prev;    /* list of ready sockets */
  20.     struct svc_sock *    sk_next;
  21.     struct svc_sock *    sk_list;    /* list of all sockets */
  22.     struct socket *        sk_sock;    /* berkeley socket layer */
  23.     struct sock *        sk_sk;        /* INET layer */
  24.  
  25.     struct svc_serv *    sk_server;    /* service for this socket */
  26.     unsigned char        sk_inuse;    /* use count */
  27.     unsigned char        sk_busy;    /* enqueued/receiving */
  28.     unsigned char        sk_conn;    /* conn pending */
  29.     unsigned char        sk_close;    /* dead or dying */
  30.     int            sk_data;    /* data pending */
  31.     unsigned int        sk_temp : 1,    /* temp socket */
  32.                 sk_qued : 1,    /* on serv->sk_sockets */
  33.                 sk_dead : 1;    /* socket closed */
  34.     int            (*sk_recvfrom)(struct svc_rqst *rqstp);
  35.     int            (*sk_sendto)(struct svc_rqst *rqstp);
  36.  
  37.     /* We keep the old state_change and data_ready CB's here */
  38.     void            (*sk_ostate)(struct sock *);
  39.     void            (*sk_odata)(struct sock *, int bytes);
  40.  
  41.     /* private TCP part */
  42.     int            sk_reclen;    /* length of record */
  43.     int            sk_tcplen;    /* current read length */
  44.  
  45.     /* Debugging */
  46.     struct svc_rqst *    sk_rqstp;
  47. };
  48.  
  49. /*
  50.  * Function prototypes.
  51.  */
  52. int        svc_makesock(struct svc_serv *, int, unsigned short);
  53. void        svc_delete_socket(struct svc_sock *);
  54. int        svc_recv(struct svc_serv *, struct svc_rqst *, long);
  55. int        svc_send(struct svc_rqst *);
  56. void        svc_drop(struct svc_rqst *);
  57.  
  58. #endif /* SUNRPC_SVCSOCK_H */
  59.